package start;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

public class Test01 {
    public Test01() {
        ApplicationContext context = new ClassPathXmlApplicationContext("META-INF\\beans.xml");
        DriverManagerDataSource datatSource = (DriverManagerDataSource)context.getBean("dataSource");            
        JdbcActorDao jdbcActorDao = new JdbcActorDao();
        jdbcActorDao.setDataSource(datatSource);
        Actor actor = jdbcActorDao.readActor(2L);
        System.out.println(actor);
        System.out.println(jdbcActorDao.getActorName(2L));
        System.out.println(jdbcActorDao.getActorsList());
    }
}
